#ifndef _SNIFF232_H_
#define _SNIFF232_H_

#include <stdio.h>

#define BUFSZ		32
#define HDSTEP		16
#define MAX(a,b) ( (a > b) ? a : b )

#define	NO_MODE			0x00
#define OBUF_ENABLE		0x01
#define NC_MODE_READ	0x02
#define NC_MODE_WRITE	0x04
#define	TCPBR_MODE		0x08

#define	RUN_MODE(x)		(x & 0xE)

typedef struct
{
    char    *progname;
    
    char    *P_arg, *p_arg, *S_arg, *s_arg, *N_arg, *n_arg, *r_arg;
    int     fd1, fd2;
    int     port1_spd, port2_spd;
    
    char    *dump_filename;
    FILE    *dump_stream;
	
	int		modes;
	int		flags;
} config_t;

extern int ctrlc;

int     xfer(int, int, char *, int);
void	cleanup(config_t *cfg);

#endif /* _SNIFF232_H_ */